<template>
  <div>
    <NavType />
    <List />
    <Recommend />
    <Rank />
    <Like />
    <Floor v-for="floor in floorList" :key="floor.id" :floor="floor" />
    <Brand />
  </div>
</template>

<script>
import List from "@/pages/Home/List/List";
import Recommend from "@/pages/Home/Recommend/Recommend";
import Rank from "@/pages/Home/Rank/Rank";
import Like from "@/pages/Home/Like/Like";
import Floor from "@/pages/Home/Floor/Floor";
import Brand from "@/pages/Home/Brand/Brand";

import { getMockFloorList } from "@/api";
export default {
  name: "Home",
  components: { List, Recommend, Rank, Like, Floor, Brand },
  data() {
    return {
      floorList: [],
    };
  },
  mounted() {
    this.getMockFloorList();
  },
  methods: {
    //封装请求floor数据函数
    async getMockFloorList() {
      const result = await getMockFloorList();
      this.floorList = result;
    },
  },
};
</script>

<style  lang="less" scoped></style>
